<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>为图片设置边框</title>
<style>
body{
font-family:微软雅黑}

</style>
<script src="../JS/vue.js"></script>
</head>
<body>
<div id="example">
  	边框宽度：<input type="text" v-model="border">
	<p>
		<img width="200" src="line.jpg" v-set-border="border">
	</p>
</div>
<script type="text/javascript">
var vm = new Vue({
	el:'#example',
	data: {
        border: ''
    },
    directives: {
        setBorder: {
            update: function (el,binding) {
				el.border = binding.value;//设置元素边框
            }
        }
    }
})
</script>


</body>

</html>



